package exception;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        try(
            FileOutputStream fos = new FileOutputStream("fos.dat");
        ){
            String line = "abc";
            fos.write(line.getBytes(StandardCharsets.UTF_8));
        }catch (IOException e){
            e.printStackTrace();
        }











    }
}
